package com.frame.database.operate;

import java.io.File;
import java.util.ArrayList;
import java.util.List;

import com.frame.common.SystemConfig;

/**
 * @Title: 系统
 * @Description:
 * @Copyright: Copyright (c) 2014
 * @Company:
 * @author 王海锋
 * @CreatedTime:2014-4-15 上午10:32:18
 * @version 1.0
 */

public class HibernateLoader {
    protected List<String> load(){
        List<String> cfgList=new ArrayList<String>();
        //HibernateLoader.class.getClassLoader().getResource("/")
        String cfgpath=SystemConfig.getInstance().getRootPath()+"/WEB-INF/classes/hib_cfg/";
        File file=new File(cfgpath);
        String[] files=file.list();
        for(int i=0;i<files.length;i++){
            if(!files[i].endsWith("cfg.xml"))
                continue;
            if(files[i].equalsIgnoreCase("hibernate.cfg.xml"))
                continue;
            cfgList.add(files[i]);
        }
        return cfgList;
    }
}
